using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Sundstrom.Mvvm.Tests.ViewModels
{
    [TestClass]
    public class ViewModelBaseTests
    {
        [TestMethod]
        public void PropertyChanged()
        {
            ViewModel1 vm = new ViewModel1();

            string propertyName = null;

            vm.PropertyChanged += (sender, args) =>
                {
                    propertyName = args.PropertyName;
                };

            Assert.IsTrue(vm.SampleProperty == "Hello World!");

            vm.SampleProperty = "Hello";

            Assert.IsTrue(vm.SampleProperty == "Hello");
            Assert.IsTrue(propertyName == "SampleProperty");
        }
    }
}